import React, { Component } from 'react';
import {HomeClassifyStyled} from 'styled/Home/HomeClassifyStyled'
import {homeGetClassify} from 'api/homeApi'
class HomeClassify extends Component {
    constructor(props) {
        super(props);
        this.state={
            classifyData:[],
            path:'http://static.jiudoujishi.com/',
        }
    }

    componentDidMount() {
        homeGetClassify().then((ok)=>{
            // console.log(ok)
            this.setState({
                classifyData:ok
            })
        })
    }
    
    
    render() {
        return (
            <HomeClassifyStyled>
                {
                    this.state.classifyData.map((v,i)=>{
                        return (
                            <div key={i} className="item">
                                <img src={'http://static.jiudoujishi.com/'+v.icon} alt=""/>
                                <span>{v.title}</span>
                            </div>
                        )
                    })
                }
            </HomeClassifyStyled>
        );
    }
}

export default HomeClassify;